package com.molihub.service.impl;

import com.molihub.entity.RequestMessage;
import com.molihub.service.RequestMessageService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: RequestMessageServiceImpl
 * @Description: 处理请求消息的业务层接口的实现层
 * @author: GGBOY
 * @date 2020/2/2 13:17
 * @Version: 1.0
 **/
@Service
public class RequestMessageServiceImpl extends BaseService implements RequestMessageService {
    @Override
    public Integer addMessage(RequestMessage requestMessage) {
        return requestMessageMapper.addMessage(requestMessage);
    }

    @Override
    public List<RequestMessage> findMessageByIdAndFlag(Integer aUserId, Integer bUserId, Integer flag) {
        return requestMessageMapper.findMessageByIdAndFlag(aUserId, bUserId, flag);
    }

    @Override
    public List<RequestMessage> findMessageByReceiveUserId(Integer bUserId) {
        return requestMessageMapper.findMessageByReceiveUserId(bUserId);
    }

    @Override
    public Integer updateMessage(RequestMessage requestMessage) {
        return requestMessageMapper.updateMessage(requestMessage);
    }

    @Override
    public Integer updateChatMessage(Integer receiveUserId) {
        return requestMessageMapper.updateChatMessage(receiveUserId);
    }

    @Override
    public List<RequestMessage> findChatMessageById(Integer aUserId, Integer bUserId) {
        return requestMessageMapper.findChatMessageById(aUserId, bUserId);
    }

    @Override
    public void readAll(Integer userId) {
        requestMessageMapper.readAll(userId);
    }
}
